Image rotation in multiples of 90º can be done on any image type (bi-tonal, grayscale, or color).
The function IG_REC_image_orient() immediately rotates and/or mirrors a whole single image in the recognition engine's memory space. Seven combinations of rotation and mirroring are available. This function ignores the image rotation mode setting of the recognition engine. The transformed image replaces the original one, keeping its type and format. It remains in the recognition engine's memory space, but is available to the application.
A rotation mode setting is made with IG_REC_orientation_mode_set(), taking values from enumIGRecImgRotate. These are:
- IG_REC_IMG_ROTATE_AUTO: Images are examined and if necessary rotated (default).
- IG_REC_IMG_ROTATE_NO: Rotation is not performed.
- IG_REC_IMG_ROTATE_RIGHT: Rotate the images to the right (clockwise).
- IG_REC_IMG_ROTATE_DOWN: Rotate the images down (rotate twice).
- IG_REC_IMG_ROTATE_LEFT: Rotate the images to the left (counter-clockwise).
- IG_REC_IMG_ROTATE_FLIPPED: Mirror the images without rotation (mirrored around the Y-axes).
- IG_REC_IMG_ROTATE_RIGHT_FLIPPED: Mirror the images, then rotate to the right.
- IG_REC_IMG_ROTATE_DOWN_FLIPPED: Mirror the images, then rotate twice.
- IG_REC_IMG_ROTATE_LEFT_FLIPPED: Mirror the images, then rotate to the left.
This mode-induced rotation is performed whenever IG_REC_image_preprocess() is called. When a fixed value is given (e.g., IG_REC_IMG_ROTATE_RIGHT), the original image is rotated.
When IG_REC_IMG_ROTATE_AUTO is set, grayscale or color images undergo an implicit secondary conversion to create a clean bi-tonal image. If IG_REC_IMG_ROTATE_AUTO is set and despeckle mode is ON for a bi-tonal image with over 280 dpi, a despeckled bi-tonal image is created. Orientation detection is done on the bi-tonal image - the despeckled one, if available. This bi-tonal image is not available to the application. The required rotation is performed on the original image. In both cases, the original rotated image remains in the recognition engine's memory space and is available to the application.